package com.hosever.action;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ShuminghaoTest {
	private void a(){
		String s = "《医疗》123医疗1232《保险》";
		List<String> list = new ArrayList<String>();
		Pattern p = Pattern.compile("《.*?》");
		Matcher m = p.matcher(s);
		while (m.find()){
            list.add(m.group());
        }
		for (String string : list) {
			String r = string.replace("《", "《a");
			r = r.replace("》", "/a》");
			s = s.replaceAll(string, r);
		}
		System.out.println(s);
	}
	
	public static void main(String[] args) {
		ShuminghaoTest test = new ShuminghaoTest();
		test.a();
	}
}
